Skip to content

Fix reflection invocation of PdeLanguageServer #1109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025

Conversation

ovalnine
Copy link
Contributor

Fixed argument type mismatch when invoking the PdeLanguageServer main method via reflection.

Changed from using spread operator with a list wrapper to passing a properly typed String array directly.

This resolves the IllegalArgumentException thrown during language server initialization.

Exception in thread "main" java.lang.InternalError: Failed to invoke main method
	at processing.app.LSP.run(Processing.kt:57)
	at com.github.ajalt.clikt.command.CoreSuspendingCliktCommandKt.parse(CoreSuspendingCliktCommand.kt:68)
	at com.github.ajalt.clikt.command.CoreSuspendingCliktCommandKt.main(CoreSuspendingCliktCommand.kt:39)
	at com.github.ajalt.clikt.command.CoreSuspendingCliktCommandKt.main(CoreSuspendingCliktCommand.kt:51)
	at processing.app.ProcessingKt.main(Processing.kt:45)
	at processing.app.ProcessingKt$main$2.invoke(Processing.kt)
	at processing.app.ProcessingKt$main$2.invoke(Processing.kt)
	at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$1.invokeSuspend(IntrinsicsJvm.kt:223)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlin.coroutines.ContinuationKt.startCoroutine(Continuation.kt:115)
	at kotlin.coroutines.jvm.internal.RunSuspendKt.runSuspend(RunSuspend.kt:19)
	at processing.app.ProcessingKt.main(Processing.kt)
Caused by: java.lang.IllegalArgumentException: argument type mismatch
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at processing.app.LSP.run(Processing.kt:55)
	... 11 more

Fixed argument type mismatch when invoking the PdeLanguageServer main method via reflection.
Changed from using spread operator with a list wrapper to passing a properly typed String array directly.
This resolves the IllegalArgumentException thrown during language server initialization.
@Stefterv
Copy link
Collaborator

Thank you @ovalnine I had noticed this myself as well in another branch I was working on.

@Stefterv Stefterv added this to the 4.4.5 milestone May 18, 2025
@Stefterv Stefterv merged commit 1acf9c5 into processing:main Jun 20, 2025
@Stefterv
Copy link
Collaborator

@all-contributors please add @ovalnine for code

Copy link
Contributor

@Stefterv

I've put up a pull request to add @ovalnine! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants